#pragma once

#include <algorithm/analytical_model/algorithm/cuda/receiver/Receiver.cuh>

#include <tuple>

namespace solar::cuda
{
    class ImagePlane : public Receiver
    {
        public:
            __device__ ImagePlane() = default;
            __host__ ImagePlane(cudaStream_t stream = nullptr);
            __device__ __host__ auto intersect(const float3& orig, const float3& dir)
                -> std::tuple<float, float, float, bool>;
            void setAxis(const float3& x, const float3& y);
            void init(float pixel_per_meter_for_receiver) override;
            void setResolution(float pixel_per_meter_for_receiver) override;
            __host__ __device__ auto getFocusCenter(const float3& heliostat_position) -> float3 override;

            float3 rect_vertices_[4]{};
            float3 x_{};
            float3 y_{};

        private:
            void setVertex();
    };
} // namespace solar::cuda
